package Ex01.Stage002;

import java.util.Scanner;

/**
 * @author 73594
 */
public class Menu {
    public Goods[] goods = new Goods[10];

    public void setData(Goods[] goods){
        this.goods = goods;
    }

    /**
     * 显示ZlT购物主菜单
     */
    public void showMainMenu() {
        System.out.println("\n\n\t\t\t\t   \n");
        System.out.println("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
        System.out.println("\t\t\t\t 1. 购 物 结 算\n");
        System.out.println("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
        System.out.print("请选择,输入数字:");
        Scanner input = new Scanner(System.in);
        boolean con = false;
        do{
            String num = input.next();
            if(num.equals("1")){
                Pay pay = new Pay();
                pay.setData(goods);
                pay.calcPrice();
                break;
            }else{
                System.out.print("输入错误，请重新输入数字：");
                con = false;
            }
        }while(!con);
    }

}
